Skip to content
This repository was archived by the owner on Jan 14, 2024. It is now read-only.

WM_4 - ALESSANDRA_SOUSA - JAVASCRIPT - WEEK 1 - #351

Open
AlessandraCYF wants to merge 4 commits into
CodeYourFuture:masterfrom
AlessandraCYF:master
Open

WM_4 - ALESSANDRA_SOUSA - JAVASCRIPT - WEEK 1#351
AlessandraCYF wants to merge 4 commits into
CodeYourFuture:masterfrom
AlessandraCYF:master

Conversation

@AlessandraCYF

@AlessandraCYF AlessandraCYF commented Aug 5, 2022

Copy link
Copy Markdown

Volunteers: Are you marking this coursework? You can find a guide on how to mark this coursework in HOW_TO_MARK.md in the root of this repository

Your Details

  • Your Name:
  • Your City:
  • Your Slack Name:

Homework Details

  • Module:
  • Week:

Notes

  • What did you find easy?

  • What did you find hard?

  • What do you still not understand?

  • Any other notes?


View rendered exercises/G-numbers/README.md

@jcholyhead jcholyhead left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A good rule of thumb for JS "variables". Always use the const keyword, unless the variable must change later in the script. This small change will make your code look a lot more 'professional' and will make it stand out during a job application process.

Comment on lines +3 to +7
let mentor1 = "Daniel";
let mentor2 = "Irina";
let mentor3 = "Mimi";
let mentor4 = "Rob";
let mentor5 = "Yohannes";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These variables don't do anything here, because you are passing the strings directly into the mentor parameter.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected, thank you.

Comment thread mandatory/3-function-output.js Outdated
function concatenate(firstWord, secondWord, thirdWord) {
// Write the body of this function to concatenate three words together.
// Look at the test case below to understand what this function is expected to return.
return word.concat(firstWord, secondWord, thirdWord);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this will work - what is word?

The concat function is called on a string. You can solve this exercise with this function, but it will look (something) like this:

return firstWord.concat(" ", secondWord, " ", thirdWord);

Better to use interpolation:

return `${firstWord} ${secondWord} ${thirdWord}`;

@AlessandraCYF
AlessandraCYF marked this pull request as draft August 6, 2022 16:11
@AlessandraCYF
AlessandraCYF marked this pull request as ready for review August 11, 2022 18:32
@AlessandraCYF

Copy link
Copy Markdown
Author

After trying to correct the errors.


function getStringLength(word) {
return "word".length();
return word.length();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You do not need to use () when you call length(). It should be word.length, without a function call.
Please check this: https://www.w3schools.com/jsref/jsref_length_string.asp

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants